home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / StickyClick 2.0 ƒ / StickyClick v2.0d1 ƒ / Patches.h next >
Encoding:
Text File  |  1992-06-18  |  3.1 KB  |  145 lines  |  [TEXT/KAHL]

  1. typedef enum {
  2.     eInitialClick,
  3.     eFirstMouseUp,
  4.     eSecondClick,
  5.     eSecondMouseUp
  6. } ClickSet;
  7.  
  8. typedef enum {
  9.     eNullEvent,
  10.     eStart,            // grab the mouse position for restoration later, if needed
  11.     
  12.     eStopBad,        // don't you let that deal go down
  13.     eStopGood,        // let that wheel go round!
  14.     eStopCleanup,    // for internal use only!
  15.  
  16.     eNextMenu,
  17.     ePrevMenu,
  18.     eFirstMenu,
  19.     eLastMenu,
  20.     ePrevItem,
  21.     eNextItem
  22. } StickyEvent;
  23.  
  24. /******************************************************************************************/
  25.  
  26. class PostEventPatch : public GenericPatch {
  27. public:
  28.     PostEventPatch(void);
  29.     void Behavior(void);
  30.  
  31.     long FakeNavigation(void);
  32.  
  33. private:
  34.     ClickSet itsClick;
  35.     Point itsLastMouse;
  36.     unsigned long itsLastTime;
  37. };
  38.  
  39. /******************************************************************************************/
  40.  
  41. class ButtonPatch : public GenericPatch {
  42. public:
  43.     ButtonPatch(void);
  44.     void Behavior(void);
  45. };
  46.  
  47. typedef struct {
  48.     short    itsResult;
  49. } ButtonPatchParms;
  50.  
  51. /******************************************************************************************/
  52.  
  53. #if 1
  54. class PopupMenuSelectPatch : public GenericPatch {
  55. public:
  56.     PopupMenuSelectPatch(void);
  57.     virtual void Behavior(void);
  58. };
  59.  
  60. typedef struct {
  61.     short            itsItem;
  62.     short            itsLeft;
  63.     short            itsTop;
  64.     MenuHandle        itsMenuHandle;
  65.     unsigned long    itsResult;
  66. } PopupMenuSelectParameters;
  67.  
  68. typedef struct PopupMenuSelectParameters ;
  69. typedef pascal long (*PopupMenuSelectProcPtr) (MenuHandle theMenu, short top, short left, short item);
  70.  
  71. #endif
  72.  
  73. /******************************************************************************************/
  74.  
  75. class MenuSelectPatch : public GenericPatch {
  76. public:
  77.     MenuSelectPatch();
  78.     virtual void Behavior(void);
  79. };
  80.  
  81. typedef struct MenuSelectParameters {
  82.     Point itsStartPt;
  83.     long itsResult;
  84. } MenuSelectParameters;
  85.  
  86. typedef pascal long (*MenuSelectProcPtr) (Point pt);
  87.  
  88. /******************************************************************************************/
  89.  
  90. class GetMousePatch : public GenericPatch {
  91. public:
  92.     GetMousePatch();
  93.     virtual void Behavior(void);
  94. };
  95.  
  96. typedef struct GetMouseParameters {
  97.     Point *itsPoint;
  98.     unsigned long dummy;
  99. } GetMouseParameters;
  100.  
  101. /******************************************************************************************/
  102.  
  103. class EventAvailPatch : public GenericPatch {
  104. public:
  105.     EventAvailPatch();
  106.     virtual void Behavior();
  107.  
  108.     void SetStickyEvent(StickyEvent event);
  109.     void SetupNavigation(void);
  110.  
  111. private:
  112.     short NumRealMenus(void);
  113.     short FindMenuItemVPos(MenuHandle hMenu, short item);
  114.     
  115.     Boolean FindMenuTitleLoc(Boolean next, Point *loc);
  116.     Boolean FindFirstMenuLoc(Point *loc);
  117.     Boolean FindLastMenuLoc(Point *loc);
  118.     Boolean FindMenuItemLoc(Boolean next, Point *loc);
  119.     
  120. private:
  121.     StickyEvent itsEvent;
  122.     Boolean itsFromStart;
  123.     Point itsInitialLoc;
  124. };
  125.  
  126. typedef struct EventAvailParameters {
  127.     EventRecord *itsEvent;
  128.     short        itsMask;
  129.     Boolean        itsResult;
  130. } EventAvailParameters;
  131.  
  132. ///////////////////////////////////////////////////////////////////////////
  133.  
  134. class MenuKeyPatch : public GenericPatch {
  135. public:
  136.     MenuKeyPatch(void);
  137.     virtual void Behavior(void);
  138. };
  139.  
  140. typedef struct {
  141.     char            padding;
  142.     char            itsKey;
  143.     unsigned long    itsResult;
  144. } MenuKeyParameters;
  145.